/**
 * 中国9号健康产业有限公司
 * Copyright (C) JiuHaoHealth Corporation. All Rights Reserved
 */
package com.jiuhaohealth.log.launcher.weblistener;

import javax.servlet.ServletRequestEvent;
import javax.servlet.ServletRequestListener;
import javax.servlet.http.HttpServletRequest;

import com.jiuhaohealth.log.launcher.conf.LauncherConfig;
import com.jiuhaohealth.log.launcher.handler.LauncherUtil;

/**
 * 
 * @author zhangguohua zhanggh@jiuhaohealth.com
 *监听全部请求
 *整理信息
 *发射到目的地
 */
public class LauncherRequestListener implements ServletRequestListener{
	private LauncherConfig launchConfig = LauncherConfig.getInstance();
	
	@Override
	public void requestDestroyed(ServletRequestEvent event){
	}

	@Override
	public void requestInitialized(ServletRequestEvent event){
		HttpServletRequest request = (HttpServletRequest)event.getServletRequest();
		String msg = LauncherUtil.loadRequestInfo(request);
		launchConfig.client.launch(msg);
		msg = null;
	}
}
